﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Csharpzuoye.procedure
{
    public class Transmit
    {
        //值类型的值传递
        //static void grow(int a)
        //{
        //    a++;
        //}


        //static void Main(string[] args)
        //{
        //    int age = 18;
        //    grow(age);
        //    Console.WriteLine(age);//age = 18
        //}

        //值类型的引用传递
        //static void swap(ref int a,ref int b)
        //{
        //    int temp = a;
        //    a = b;
        //    b = temp;
        //}

        //static void Main(string[] args)
        //{
        //    int a = 18;
        //    int b = 80;
        //    swap(ref a,ref b);
        //    Console.WriteLine(a);
        //    Console.WriteLine(b);
        //}


        //引用类型的值传递
        //public int age;
        //public void grow(Student student)
        //{
        //    student.age++;

        //}

        //static void Main(string[] args)
        //{
        //Student syt = new Student();
        //syt.age = 18;
        //syt.grow(syt);
        //Console.WriteLine(syt.age); //age = 19

        //}

        //引用类型的引用传递
        //public int age;
        //public Student grow(ref Student student)
        //{
        //    student = new Student();  
        //    student.age++;

        //}
    }
}
